<%@page import="fr.cinescope2014.modeles.SallePeripherie"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8" %>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Salles de la Périphérie</title>
        <link href="/CineScope2014FO/css/principal.css" rel="stylesheet" type="text/css">
    </head>

    <body>
        <%@include file="../jsp/_entete.jsp" %>
        <%@include file="../jsp/_rechercher.jsp" %>
        <%@include file="../jsp/_sommaire.jsp" %>

<div id="centre">

    <h3>Salles de la Périphérie</h3>

    <%-- Modele --%>
    <%!
    %>
            <%                // Ah !
                String lsDepartementAvant = "";
                String lsDepartementCourant = "";
                
                String lsVilleAvant = "";
                String lsVilleCourante = "";                

                String lsCinemaAvant = "";
                String lsCinemaCourant = "";

                List<SallePeripherie> liste = (List) request.getAttribute("liste");
                for (SallePeripherie sp : liste) {

            %>
            <%      // Ah !!!      
                lsDepartementCourant = sp.getNomDepartement();
                if (!lsDepartementCourant.equals(lsDepartementAvant)) {
                    out.println("<hr/>");
                    out.println(sp.getNomDepartement());
                    lsDepartementAvant = lsDepartementCourant;
                }
            %>
            
            <%      // Ah !!!      
                lsVilleCourante = sp.getNomVille();
                if (!lsVilleCourante.equals(lsVilleAvant)) {
                    out.println("<hr/>");
                    out.println(sp.getNomVille());
                    out.println("<hr/>");
                    lsVilleAvant = lsVilleCourante;
                }
            %>            


            <% // Ah!!!!
                lsCinemaCourant = sp.getNomCinema();
                if (!lsCinemaCourant.equals(lsCinemaAvant)) {
                    out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='lienNoir'>" + lsCinemaCourant + "</a>");
                    out.println("<br/>");
                    lsCinemaAvant = lsCinemaCourant;
                }
            %>
            <% // ...
                out.print("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' class='lienRouge'>" + sp.getTitreFilm() + "</a>");
                if (sp.getVersionProjection() != null) {
                    out.print(" (" + sp.getVersionProjection() + ")");
                }
            %>

            <br/>
            <%
                }
            %>  

</div>

        <%@include file="../jsp/_pied.jsp" %>
    </body>
</html>